<?php
	include_once("../includes/header.php");
	include_once("../includes/common.php");
	include_once("../includes/connect.php");
	include_once("../includes/functions.php");
?>	<!-- ************** V MAIN CONTENT HERE  V ********************************************************************************** -->  
	
	<h3>Add New Question</h3>

	<?php
		if ($_SERVER['REQUEST_METHOD'] == "POST")
		{
			if ($_POST["submit"] != "No")
			{
				$mode = "add";
				include_once("../includes/validatequestion.php");
			}
		}
		
		if (sizeof($errors) > 0 || ($_SERVER['REQUEST_METHOD'] == "POST" && $_POST["submit"] == "No") || $_SERVER['REQUEST_METHOD'] != "POST")
		{
	?>
	<form action="<?php echo $_SERVER['../question/PHP_SELF']; ?>" method="post" >
		<ol>
		  <li>
			<label for="name">Descriptive Statement *</label>
			<input name="qstatement" class="text" value="<?php echo (isset($_POST["qstatement"])) ? $_POST["qstatement"] : "" ?>" />
		  </li>
		  <li>
			<label for="name">Presentation</label>
			<select name="is_lab" >
				<option value="0">Lecture</option>
				<option value="1">Laboratory</option>
			</select>
		  </li>		  
		  <li>
			<label for="name">Group</label>
			<select name="qgroupid" >
			<?php
				$data = $conn1->Execute("SELECT id as id, name as name FROM qgroup WHERE deleted = '0'");
				dropDownOptions("id","name",$data,(isset($_POST["qgroupid"]) ? $_POST["qgroupid"] : "" ));
			?>
			</select>
		  </li>		  
		  <li>
			<label for="name"></label>
			<p style="font-style: italic; font-size: 10px; color:#333333"><b>Note</b>: IGNORE Group for Qualitative Questions</p>
		  </li>		  
		  <li>
			<label for="name">Category</label>
			<select name="qcategoryid" >
			<?php
				$data = $conn1->Execute("SELECT id as id, name as name FROM qcategory WHERE deleted = '0'");
				dropDownOptions("id","name",$data,(isset($_POST["qcategoryid"]) ? $_POST["qcategoryid"] : "" ));
			?>
			</select>
		  </li>		  
		  <li>
			<label>&nbsp;</label>
			<input type="submit" name="submit" value="Submit" onClick="" />
		  </li>
		</ol>
	</form>	 

<?php 
		}
	include_once("../includes/sidebar.php");
	include_once("../includes/footer.php");
?>
